package com.xt.wikiperfumapi.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 
 * @TableName perfume_info
 */
@TableName(value ="perfume_info")
@Data
public class PerfumeInfo implements Serializable {
    /**
     * 香水id
     */
    @TableId(type = IdType.AUTO)
    private Long perfumeId;

    /**
     * 香水名称
     */
    private String name;

    /**
     * 价格
     */
    private BigDecimal price;

    /**
     * 年份
     */
    private Integer year;

    /**
     * 性别
     */
    private String sex;

    /**
     * 概念
     */
    private String concept;

    /**
     * 说明
     */
    private String explains;

    /**
     * 冲突，世界的芬芳
     */
    private String aroma;

    /**
     * 品牌id
     */
    private Long brandId;

    /**
     * 嗅觉
     */
    private String smell;

    /**
     * 是否删除
     */
    private Integer isDeleted;

    /**
     * 插入时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date inputTime;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date updateTime;

    /**
     * 香调
     */
    private String fragranceNote;

    /**
     * 香型
     */
    private String flavor;

    /**
     * 上线时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date uptime;

    /**
     * 香水图片
     */
    private String img;

    /**
     * 原料，json化
     */
    private String ingredients;

    /**
     * 品牌
     */
    private String brandText;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PerfumeInfo other = (PerfumeInfo) that;
        return (this.getPerfumeId() == null ? other.getPerfumeId() == null : this.getPerfumeId().equals(other.getPerfumeId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getYear() == null ? other.getYear() == null : this.getYear().equals(other.getYear()))
            && (this.getSex() == null ? other.getSex() == null : this.getSex().equals(other.getSex()))
            && (this.getConcept() == null ? other.getConcept() == null : this.getConcept().equals(other.getConcept()))
            && (this.getExplains() == null ? other.getExplains() == null : this.getExplains().equals(other.getExplains()))
            && (this.getAroma() == null ? other.getAroma() == null : this.getAroma().equals(other.getAroma()))
            && (this.getBrandId() == null ? other.getBrandId() == null : this.getBrandId().equals(other.getBrandId()))
            && (this.getSmell() == null ? other.getSmell() == null : this.getSmell().equals(other.getSmell()))
            && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()))
            && (this.getInputTime() == null ? other.getInputTime() == null : this.getInputTime().equals(other.getInputTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getFragranceNote() == null ? other.getFragranceNote() == null : this.getFragranceNote().equals(other.getFragranceNote()))
            && (this.getFlavor() == null ? other.getFlavor() == null : this.getFlavor().equals(other.getFlavor()))
            && (this.getUptime() == null ? other.getUptime() == null : this.getUptime().equals(other.getUptime()))
            && (this.getImg() == null ? other.getImg() == null : this.getImg().equals(other.getImg()))
            && (this.getIngredients() == null ? other.getIngredients() == null : this.getIngredients().equals(other.getIngredients()))
            && (this.getBrandText() == null ? other.getBrandText() == null : this.getBrandText().equals(other.getBrandText()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getPerfumeId() == null) ? 0 : getPerfumeId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getYear() == null) ? 0 : getYear().hashCode());
        result = prime * result + ((getSex() == null) ? 0 : getSex().hashCode());
        result = prime * result + ((getConcept() == null) ? 0 : getConcept().hashCode());
        result = prime * result + ((getExplains() == null) ? 0 : getExplains().hashCode());
        result = prime * result + ((getAroma() == null) ? 0 : getAroma().hashCode());
        result = prime * result + ((getBrandId() == null) ? 0 : getBrandId().hashCode());
        result = prime * result + ((getSmell() == null) ? 0 : getSmell().hashCode());
        result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
        result = prime * result + ((getInputTime() == null) ? 0 : getInputTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getFragranceNote() == null) ? 0 : getFragranceNote().hashCode());
        result = prime * result + ((getFlavor() == null) ? 0 : getFlavor().hashCode());
        result = prime * result + ((getUptime() == null) ? 0 : getUptime().hashCode());
        result = prime * result + ((getImg() == null) ? 0 : getImg().hashCode());
        result = prime * result + ((getIngredients() == null) ? 0 : getIngredients().hashCode());
        result = prime * result + ((getBrandText() == null) ? 0 : getBrandText().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", perfumeId=").append(perfumeId);
        sb.append(", name=").append(name);
        sb.append(", price=").append(price);
        sb.append(", year=").append(year);
        sb.append(", sex=").append(sex);
        sb.append(", concept=").append(concept);
        sb.append(", explains=").append(explains);
        sb.append(", aroma=").append(aroma);
        sb.append(", brandId=").append(brandId);
        sb.append(", smell=").append(smell);
        sb.append(", isDeleted=").append(isDeleted);
        sb.append(", inputTime=").append(inputTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", fragranceNote=").append(fragranceNote);
        sb.append(", flavor=").append(flavor);
        sb.append(", uptime=").append(uptime);
        sb.append(", img=").append(img);
        sb.append(", ingredients=").append(ingredients);
        sb.append(", brandText=").append(brandText);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}